N
AME
add_constant
- add new predefined functions or constants
S
YNTAX
void add_constant(string
name
, mixed
value
);
or
void add_constant(string
name
);
D
ESCRIPTION
This function adds a new constant to Pike, it is often used to add builin functions (efuns). All programs compiled after add_constant function is called can access 'value' by the name given by 'name'. If there is a constant called 'name' already, it will be replaced by by the new definition. This will not affect already compiled programs.
Calling add_constant without a value will remove that name from the list
of of constant. As with replacing, this will not affect already compiled
programs.
E
XAMPLES
add_constant("true",1);
add_constant("false",0);
add_constant("PI",4.0);
add_constant("sqr",lambda(mixed x) { return x * x; });
add_constant("add_constant");
S
EE
A
LSO
all_constants